package com.dubito.pattern.创建型模式.单例模式.懒汉式;

/**
 * @author liliang
 * @date 2020/8/26.
 */
public class Singleton {

    private static Singleton instance = null;

    private Singleton() {}

    public synchronized static Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }
}
